import Main from '../views/index.vue'
// import Abstract from '../views/layout/abstract.vue'
// import Home from '../views/home/home.vue'
// import Login from '../views/login.vue'
// import knowLedge from '../views/knowLedge/index.vue'

const Abstract = () => import('../views/layout/abstract.vue')
const Home = () => import('../views/home/home.vue')
const Login = () => import('../views/login.vue')
const knowLedge = () => import('../views/knowLedge/index.vue')

import businessList from '@/views/business/businessList.vue'

import goodsSellingList from '@/views/goodsManger/goodsSellingList.vue' //在售商品
import goodsSeekList from '@/views/goodsManger/goodsSeekList.vue' //求购商品
import goodsAuditingList from '@/views/goodsManger/goodsAuditingList.vue' //待审核商品
import goodsAudSeekList from '@/views/goodsManger/goodsAudSeekList.vue' //待审核求购商品


import bannerList from '@/views/activity/bannerList.vue' //
import redPacket from '@/views/activity/redPacket.vue' //
import menuList from '@/views/system/menuList.vue' //




import dataPage from '@/views/data/data.vue'

import questionList from '@/views/manageOffice/questionList.vue' //运营管理办公室列表
import agentList from '@/views/manageOffice/agentList.vue' //运营管理代办列表
import assignList from '@/views/manageOffice/assignList.vue' //运营管理代办列表

import questionAdd from '@/views/goodsManger/questionAdd.vue' //运营管理代办列表
import questionEdit from '@/views/goodsManger/questionEdit.vue' //运营管理编辑页面

import handleList from '@/views/manageOffice/handleList.vue' //运行局申诉处理列表
import userList from '@/views/system/userList.vue' //运行局申诉处理列表

import eService from '@/views/NetworkHall/enterpriseService.vue'
import Power from '@/views/NetworkHall/Power.vue'
import secondList from '@/views/NetworkHall/secondList.vue'
import serviceEdit from '@/views/NetworkHall/edit.vue'
import systemUserAdd from '@/views/system/add.vue'
//企业端
import companyInfoEdit from '@/views/company/edit.vue' //企业完善信息
import comLogin from '@/views/company/login.vue' //企业登录
import comQuestionList from '@/views/company/questionList.vue' //企业问题列表
import comIndex from '@/views/company/comIndex.vue' //企业问题列表
import comQuestionDetail from '@/views/company/detail.vue' //企业问题详情


import placeFileDetail from '@/views/placeOnFile/placeFileDetail.vue' //归档详情


export const loginRouter = {
  path: '/login',
  name: 'login',
  meta: {
    title: '登录'
  },
  component: Login
}

export const appRouter = [{
    title: '首页',
    path: '/home',
    name: 'home',
    icon: 'icon-shouye',
    component: Home,
    meta: {
      title: "首页"
    }
  },
  {
    title: '出售商品管理',
    path: '/goodsSellingList',
    name: 'goodsSellingList',
    icon: 'icon-yijian',
    component: goodsSellingList,
    isShow: true,
    meta: {
      title: "出售商品管理"
    }
  },
  {
    title: '数据统计',
    path: '/dataPage',
    name: 'dataPage',
    icon: 'icon-fenxi',
    component: dataPage
  },
  {
    title: '诉求',
    path: '/question',
    name: 'question',
    icon: 'icon-artboardcopy2',
    component: questionList,
    meta: {
      keep_alive: true
    }
  },
  {
    title: '知识库',
    path: '/knowledge',
    name: 'knowledge',
    icon: 'icon-shenqing',
    component: knowLedge
  },
  {
    title: '交办',
    path: '/assignList',
    name: 'assignList',
    icon: 'icon-guanli',
    component: assignList
  },
  {
    title: '运行局',
    path: '/user',
    name: 'user',
    icon: 'icon-duiwaishiwu',
    component: Abstract,
  },
  {
    title: '用户列表',
    path: '/userList',
    name: 'userList',
    icon: 'icon-kaifa',
    component: userList,
    meta: {
      title: "用户列表"
    }
  },
  {
    title: 'banner管理',
    path: '/bannerList',
    name: 'bannerList',
    icon: 'icon-yijian',
    isShow: true,
    component: bannerList,
    meta: {
      title: "banner管理",
      keep_alive: true
    }
  },
  {
    title: '红包管理',
    path: '/redPacket',
    name: 'redPacket',
    icon: 'icon-yijian',
    isShow: true,
    component: redPacket,
    meta: {
      title: "红包管理",
      keep_alive: true
    }
  },
  {
    title: '新建诉求',
    path: '/questionAdd',
    name: 'questionAdd',
    icon: 'icon-yijian',
    component: questionAdd,
    meta: {
      title: "新建诉求"
    }
  },
  {
    title: '诉求编辑',
    path: '/questionEdit/:id',
    name: 'questionEdit',
    icon: 'icon-yijian',
    component: questionEdit,
    meta: {
      title: "诉求编辑"
    }
  },
  {
    title: '待审核商品',
    path: '/goodsAuditingList',
    name: 'goodsAuditingList',
    icon: 'icon-yijian',
    component: goodsAuditingList,
    meta: {
      title: "待审核商品"
    }
  },
  {
    title: '待审求购管理',
    path: '/goodsAudSeekList',
    name: 'goodsAudSeekList',
    icon: 'icon-fuwushang',
    component: goodsAudSeekList,
    meta: {
      title: "待审求购管理"
    }
  },
  {
    title: '交易列表',
    path: '/businessList',
    name: 'businessList',
    icon: 'icon-fuwushang',
    component: businessList,
    meta: {
      title: "交易列表"
    }
  },
  {
    title: ' 菜单列表',
    path: '/menuList',
    name: 'menuList',
    icon: 'icon-kaifa',
    component: menuList,
    meta: {
      title: "菜单列表"
    }
  },
  {
    title: '二级列表',
    path: '/secondList/:id/:name',
    name: 'secondList',
    icon: 'icon-fuwushang',
    component: secondList,
    meta: {
      title: "二级列表"
    }
  },
  {
    title: '菜单编辑',
    path: '/serviceEdit/:fid/:id',
    name: 'serviceEdit',
    icon: 'icon-fuwushang',
    component: serviceEdit,
    meta: {
      title: "菜单编辑"
    }
  },
  {
    title: '用户添加',
    path: '/systemUserAdd/:type',
    name: 'systemUserAdd',
    icon: 'icon-fuwushang',
    component: systemUserAdd,
    meta: {
      title: "用户添加"
    }
  },
  {
    title: '求购商品管理',
    path: '/goodsSeekList',
    name: 'goodsSeekList',
    icon: 'icon-yijian',
    component: goodsSeekList,
    meta: {
      title: "求购商品管理"
    }
  },
  {
    title: '归档详情',
    path: '/placeFileDetail/:id/:type',
    name: 'placeFileDetail',
    isShow: true,
    icon: 'icon-yijian',
    component: placeFileDetail,
    meta: {
      title: "详情"
    }
  },




  // {
  //   title: '统计分析',
  //   path: '/statistics',
  //   name: 'statistics',
  //   icon: 'fa fa-home fa-lg',
  //   component: Abstract,
  //   children: [
  //     {
  //       title: '新增和启动',
  //       name: 'stats_new',
  //       path: 'new',
  //       icon: 'fa fa-home fa-lg',
  //       component: Login
  //     },
  //     {
  //       title: '活跃分析',
  //       name: 'stats_activated',
  //       path: 'activated',
  //       icon: 'fa fa-home fa-lg',
  //       component: Table
  //     },
  //     {
  //       title: '时段分析',
  //       name: 'stats_time',
  //       path: 'time',
  //       icon: 'fa fa-home fa-lg',
  //       component: Table
  //     },
  //     {
  //       title: '用户留存',
  //       name: 'retention',
  //       path: 'retention',
  //       icon: 'fa fa-home fa-lg',
  //       component: Table
  //     },
  //     {
  //       title: '流失用户',
  //       name: 'churn',
  //       path: 'churn',
  //       icon: 'fa fa-home fa-lg',
  //       component: Table
  //     }
  //   ]

  // }

]

export const mainRouter = {
  path: '/',
  redirect: '/login',
  name: 'index',
  component: Main,
  children: appRouter
}

// export const detailRouter = {
//   path: '/',
//   redirect: '/home',
//   name: 'index',
//   component: Main,
//   children:[
//     {path: 'supervise', component: supervise, name: 'supervise'}
//   ]
// }


export const routers = [
  // {path: '/supervise2',redirect: '/supervise2', name: 'supervise2',component: supervise2},

  loginRouter,
  mainRouter,
  // catch all redirect
  // {path: '*', redirect: '/home'},
  {
    title: '用户登录',
    name: 'comLogin',
    path: '/comLogin',
    component: comLogin,
    meta: {
      title: "用户登录"
    }
  },
  { //企业用户登陆页面
    title: '企业中心首页',
    path: '/comIndex',
    redirect: '/com/companyInfoEdit',

    name: 'comIndex',
    icon: 'icon-shouye',
    component: comIndex,
    meta: {
      title: "企业中心首页"
    },
    children: [{
        title: '企业完善信息',
        path: '/com/companyInfoEdit',
        name: 'companyInfoEdit',
        icon: 'icon-fuwushang',
        component: companyInfoEdit,
        meta: {
          title: "企业完善信息"
        }
      },
      {
        title: '提出诉求',
        path: '/com/comQuestionList',
        name: 'comQuestionList',
        icon: 'icon-fuwushang',
        component: comQuestionList,
        meta: {
          title: "提出诉求"
        }
      },
      {
        title: '诉求详情',
        path: '/com/comQuestionDetail/:id',
        name: 'comQuestionDetail',
        component: comQuestionDetail,
        meta: {
          title: "诉求详情"
        }
      },
    ]
  },
]
